<?php include $this->getViewFile('/common/Head') ?>
<body class="J_scroll_fixed">
<style>
.col-left{float:left}
.col-auto{overflow:hidden;_zoom:1;_float:left;}
.title-1{border-bottom:1px solid #eee; padding-left:5px}
.f14{font-size: 14px}
.lh28{line-height: 28px}
.blue,.blue a{color:#004499}
.gray4,a.gray4{color:#999;}
.lh22{line-height: 22px}
.lh25{line-height: 25px}
</style>
<div class="wrap J_check_wrap">
  <?php include $this->getViewFile('/common/Nav') ?>
  <div class="h_a">查找</div>
  <form method="post" action="" id="searchForm">
    <div class="search_type cc mb10">
      <div class="mb10"> 推广人：
        <?php
		echo Form::select(MembersGroupModel::model()->getSpreadMemberList(),$recommend,'name="recommend"','全部');
		?>
        审核时间：
        <input type="text" name="start_time" class="input length_2 J_date" value="<?php echo $start_time?>" placeholder="选择起始时间">
        -
        <input type="text" class="input length_2 J_date" name="end_time" value="<?php echo $end_time?>" placeholder="选择结束时间">
      </div>
      <div class="mb10">
        关键字：<?php echo Form::select(array(1=>'商品ID',2=>'商品名称',3=>'商品旺旺'),$type,'name="type"') ?>
        <input type="text" class="input length_2" name="keyword" style="width:200px;" value="<?php echo $keyword?>" placeholder="请输入搜索内容...">
        <button class="btn">搜索</button>
      </div>
    </div>
  </form>
  <div class="mb10"> 共有 ( <b><?php echo $count; ?></b> ) 个宝贝</div>
  <form name="myform" action="<?php echo AdminBase::U("index") ?>" method="post" class="J_ajaxForm">
    <div class="table_list">
      <table width="100%" cellspacing="0">
        <thead>
          <tr>
            <td width="50" align="center"><input type="checkbox" class="J_check_all" data-direction="x" data-checklist="J_check_x">
              全选</td>
            <td width="100" align="center">商品ID</td>
            <td align="center">商品报名信息</td>
            <td width="200" align="center">商品状态</td>
          </tr>
        </thead>
        <tbody>
          <?php
		foreach($data as $rs){
		?>
          <tr>
            <td><input type="checkbox" class="J_check" data-yid="J_check_y" data-xid="J_check_x" name="ids[]" value="<?php echo $rs->id;?>" id="att_<?php echo $rs->id;?>" /></td>
            <td align="center"><?php echo $rs->GoodsBmModel->product_id ?><p class="gray4 lh25"> 推广人<br/> 
            <?php
			echo Form::select(MembersGroupModel::model()->getSpreadMemberList(),$rs->userid,'name="recommend" data-id="'.$rs->id.'"');
		    ?>
            </td>
            <td><div class="col-left mr10" style="width:146px; height:112px"><a href="<?php echo $rs->GoodsBmModel->detail_url?>" target="_blank"><img src="<?php echo $rs->GoodsBmModel->product_img?>" width="146" height="112" style="border:1px solid #eee" align="left"></a></div>
              <div class="col-auto">
                <h2 class="title-1 f14 lh28 mb6 blue"><a href="<?php echo $rs->GoodsBmModel->detail_url ?>" target="_blank"><?php echo $rs->GoodsBmModel->goods_name ?></a></h2>
                <p class="gray4 lh25"> 原价：<font color="#FF0000"><?php echo  number_format($rs->GoodsBmModel->p_price,2)?></font>， 
                  活动价：<font color="#FF0000"><?php echo  number_format($rs->GoodsBmModel->promo_price,2)?></font>，
                  销量：<font color="#FF0000"><?php echo (int)$rs->GoodsBmModel->sales;?></font>，
                  旺旺：<b><a href="http://amos.im.alisoft.com/msg.aw?v=2&amp;site=cntaobao&amp;s=2&amp;charset=utf-8&amp;uid=<?php echo urlencode($rs->GoodsBmModel->nick)?>" target="_blank"><?php echo $rs->GoodsBmModel->nick?><img src="http://amos.im.alisoft.com/online.aw?v=2&amp;site=cntaobao&amp;s=2&amp;charset=utf-8&amp;uid=<?php echo urlencode($rs->GoodsBmModel->nick)?>" alt=""></a></b> 店铺类型：<font color="#FF0000"><?php echo GoodsBmModel::model()->getShopTypeName($rs->GoodsBmModel->item_type); ?></font> </p>
                <p class="gray4 lh25"> 报名时间：<font color="#000000"><?php echo date('Y-m-d H:i:s',$rs->GoodsBmModel->add_time)?></font>，
                  报名栏目：<font color="#0033FF"><?php echo CategoryModel::model()->getCategory($rs->GoodsBmModel->cat_id,'cat_name');?></font> </p>
                <p class="gray4 lh25"> 上架时间：<font color="#FF33FF"><?php echo date('Y-m-d H:i:s',$rs->GoodsBmModel->start_time)?></font> ，
                  下架时间：<font color="#FF33FF"><?php echo date('Y-m-d H:i:s',$rs->GoodsBmModel->end_time)?></font> </p>
              </div></td>
            <td align="center">
			<?php echo GoodsBmModel::model()->getHtmlStatus($rs->GoodsBmModel); ?>
            <br/>
            <?php
			$op = array();
			$op[] = '<a class="J_ajax_del" href="'.AdminBase::U("delete",array('id'=>$rs->id)).'" >删除</a>';
			echo implode(' | ',$op);
			?>
            </td>
          </tr>
          <?php
		}
		?>
        </tbody>
      </table>
      <div class="p10">
        <div class="pages"><?php echo $Page;?></div>
      </div>
    </div>
  </form>
</div>
<script src="<?php echo $staticUrl; ?>statics/js/common.js"></script> 
<script>
$(function(){
	$('.table_list select[name="recommend"]').change(function(){
		var id = $(this).data('id');
		var recommend = $(this).val();
		$.getJSON('<?php echo AdminBase::U("saveuser") ?>',{id:id,recommend:recommend},function(data){
			if(data.status){
				
			}else{
				alert(data.info);
			}
		});
	});
});
</script>
</body>
</html>